ROOT:=$(shell pwd)
CC=gcc
INCLUDE=-I../zlog/src
CFLAGS= -ggdb3 -fsanitize=address

LIB_PATH=$(ROOT)/../zlog/src
LIBS=-L$(LIB_PATH) -lzlog -lpthread -lhiredis -lpcap
BIN_PATH=$(ROOT)/bin
OBJ_PATH=$(ROOT)/obj



.SUFFIXES:	.pc .c .o
.c.o:
	$(CC) -c $(CFLAGS) $*.c $(INCLUDE)

all: capture analysis

clean:
	rm obj/* bin/* lib/*
capture:main.o
	$(CC) $(CFLAGS) -o $@ $? $(LIBS)
	mv $@ $(BIN_PATH)
	mv *.o $(OBJ_PATH)

analysis:parse.o
	$(CC) $(CFLAGS) -o $@ $? $(LIBS)
	mv $@ $(BIN_PATH)
	mv *.o $(OBJ_PATH)
